﻿using UnityEngine;
using System.Collections;

public class ButtonA : MonoBehaviour {
	
	public delegate void ChaangeNameAction (string s);
	
	public ChaangeNameAction nameCallBack;
    public TextMesh Text;

    public int I;
	public string name;

	public tooltip toTip;

	public Main main;
	//public AnimationClip move, idle;

    void Awake() {
        if( transform.parent != null )
            Text = transform.parent.GetComponent<TextMesh>();
    }

    void OnMouseDown () {
		nameCallBack (name);
    }

	void OnMouseEnter ()
	{
        if(toTip != null)
		    toTip.curText = name;
	}

	void OnMouseExit ()
	{
        if(toTip != null)
		    toTip.curText = "";
	}

	void callNextClip()
	{
		main.runAnimations ();
	}

	void audioPlay()
	{
		audio.Play ();
	}

}
